#include<stdio.h>
#include<unistd.h>
#include<errno.h>
#include<string.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>

#define LOG_NORMAL "logNormal.txt"
#define LOG_ERROR "logError.txt"

int main()
{
    int fd = open(LOG_NORMAL, O_CREAT | O_WRONLY | O_APPEND, 0666);
    if(fd<0)
    {
        perror("open error");
        return 1;
    }

    dup2(fd,1);

    printf("hello world!\n");

    close(fd);
}
